package com.cqyc.network.utils

import android.content.Context
import android.content.Context.MODE_PRIVATE


class SharedPreUtils(context: Context) {
    private val sharedPre = context.getSharedPreferences("shang_jia", MODE_PRIVATE)

    fun setUser(str: String) {
        val edit = sharedPre.edit()
        edit.putString("userInfo", str)
        edit.apply()
    }

    fun getUser(): String {
        return sharedPre.getString("userInfo", "")!!
    }

    //是不是正式环境
    fun devApi(api:Boolean){
        val edit = sharedPre.edit()
        edit.putBoolean("devApi", api)
        edit.commit()
    }

    fun devApi():Boolean{
        return sharedPre.getBoolean("devApi", true)
    }

}